From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0026.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0026.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0026.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0026.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0022.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0018.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0017.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0017.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0016.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0014.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0014.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0013.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0013.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0002.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0027.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0027.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0027.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0027.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0023.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0019.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0018.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0018.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0017.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0015.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0015.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0014.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0014.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0003.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0028.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0028.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0028.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0028.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0024.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0020.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0019.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0019.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0018.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0016.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0016.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0015.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0015.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0004.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0029.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0029.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0029.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0029.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0025.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0021.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0020.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0020.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0019.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0017.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0017.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0016.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0016.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0005.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0030.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0030.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0030.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0030.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0026.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0022.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0021.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0021.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0020.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0018.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0018.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0017.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0017.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0006.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0031.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0031.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0031.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0031.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0027.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0023.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0022.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0022.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0021.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0019.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0019.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0018.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0018.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0007.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0032.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0032.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0032.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0032.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0028.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0024.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0023.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0023.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0022.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0020.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0020.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0019.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0019.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0008.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0033.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0033.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0033.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0033.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0029.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0025.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0024.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0024.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0023.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0021.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0021.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0020.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0020.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0009.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0034.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0034.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0034.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0034.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0030.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0026.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0025.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0025.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0024.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0022.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0022.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0021.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0021.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0010.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0035.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0035.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0035.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0035.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0031.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0027.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0026.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0026.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0025.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0023.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0023.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0022.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0022.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0011.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0001.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0001.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0001.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0001.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0001.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0001.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0001.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0001.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0001.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0001.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0001.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0002.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0002.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0002.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0002.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0002.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0002.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0002.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0002.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0002.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0002.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0002.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0002.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0003.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0003.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0003.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0003.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0003.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0003.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0003.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0003.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0003.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0003.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0003.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0003.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0004.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0004.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0004.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0004.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0004.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0004.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0004.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0004.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0004.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0004.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0004.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0004.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0005.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0005.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0005.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0005.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0005.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0005.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0005.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0005.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0005.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0005.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0005.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0005.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0006.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0006.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0006.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0006.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0006.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0006.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0006.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0006.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0006.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0006.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0006.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0006.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0007.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0007.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0007.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0007.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0007.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0007.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0007.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0007.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0007.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0007.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0007.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0007.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0007.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0007.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0008.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0008.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0008.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0008.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0008.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0008.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0008.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0008.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0008.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0008.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0008.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0008.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0008.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0008.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0009.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0009.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0009.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0009.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0009.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0009.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0009.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0009.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0009.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0009.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0009.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0009.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0009.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0009.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0010.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0010.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0010.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0010.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0010.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0010.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0010.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0010.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0010.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0010.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0010.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0010.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0010.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0010.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0001.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0001.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0001.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0001.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0001.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0001.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0001.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0001.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0001.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0001.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0001.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0002.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0002.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0002.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0002.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0002.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0002.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0002.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0002.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0002.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0002.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0002.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0002.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0003.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0003.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0003.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0003.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0003.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0003.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0003.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0003.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0003.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0003.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0003.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0003.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0004.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0004.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0004.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0004.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0004.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0004.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0004.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0004.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0004.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0004.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0004.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0004.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0005.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0005.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0005.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0005.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0005.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0005.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0005.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0005.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0005.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0005.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0005.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0005.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0006.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0006.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0006.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0006.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0006.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0006.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0006.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0006.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0006.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0006.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0006.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0006.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0007.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0007.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0007.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0007.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0007.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0007.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0007.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0007.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0007.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0007.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0007.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0007.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0007.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0007.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0008.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0008.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0008.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0008.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0008.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0008.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0008.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0008.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0008.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0008.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0008.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0008.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0008.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0008.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0009.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0009.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0009.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0009.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0009.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0009.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0009.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0009.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0009.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0009.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0009.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0009.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0009.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0009.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0010.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0010.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0010.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0010.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0010.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0010.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0010.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0010.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0010.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0010.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0010.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0010.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0010.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0010.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0001.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0001.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0001.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0001.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0001.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0001.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0001.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0001.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0001.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0001.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0001.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0001.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0002.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0002.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0002.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0002.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0002.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0002.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0002.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0002.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0002.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0002.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0002.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0002.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0002.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0003.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0003.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0003.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0003.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0003.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0003.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0003.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0003.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0003.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0003.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0003.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0003.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0003.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0004.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0004.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0004.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0004.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0004.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0004.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0004.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0004.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0004.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0004.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0004.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0004.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0004.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0005.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0005.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0005.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0005.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0005.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0005.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0005.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0005.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0005.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0005.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0005.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0005.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0005.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0006.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0006.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0006.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0006.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0006.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0006.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0006.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0006.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0006.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0006.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0006.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0006.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0006.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0007.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0007.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0007.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0007.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0007.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0007.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0007.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0007.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0007.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0007.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0007.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0007.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0007.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0007.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0008.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0008.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0008.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0008.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070506/969b81b5/attachment-0008.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0008.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0008.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0008.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070512/630fb848/attachment-0008.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0008.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0008.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0008.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0008.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0008.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0009.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0009.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0009.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0009.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0009.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0009.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0009.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0009.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0009.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0009.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0009.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0009.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0010.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0010.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0010.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0010.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0001.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0010.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0010.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0010.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0001.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0010.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0010.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0010.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0010.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0010.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0011.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0011.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0011.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0011.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0002.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0011.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0011.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0011.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0002.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0011.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0011.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0011.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0011.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0011.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0012.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0012.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0012.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0012.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0003.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0012.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0012.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0012.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0003.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0012.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0012.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0012.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0012.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0012.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0013.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0013.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0013.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0013.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0004.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0013.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0013.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0013.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0004.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0013.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0013.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0013.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0013.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0013.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0014.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0014.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0014.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0014.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0005.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0014.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0014.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0014.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0005.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0014.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0014.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0014.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0014.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0014.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0015.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0015.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0015.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0015.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0006.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0015.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0015.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0015.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0006.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0015.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0015.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0015.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0015.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0015.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0016.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0016.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0016.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0016.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0007.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0016.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0016.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0016.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0007.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0016.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0016.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0016.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0016.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0016.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0017.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0017.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0017.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0017.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0008.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0017.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0017.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0017.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0008.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0017.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0017.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0017.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0017.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0017.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0018.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0018.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0018.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0018.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0009.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0018.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0018.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0018.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0009.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0018.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0018.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0018.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0018.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0018.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0019.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0019.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0019.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0019.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0010.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0019.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0019.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0019.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0010.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0019.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0019.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0019.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0019.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0019.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0020.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0020.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0020.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0020.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0011.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0020.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0020.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0020.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0011.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0020.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0020.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0020.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0020.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0020.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0021.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0021.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0021.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0021.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0012.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0021.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0021.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0021.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0012.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0021.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0021.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0021.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0021.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0021.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0022.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0022.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0022.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0022.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0013.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0022.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0022.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0022.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0013.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0022.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0022.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0022.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0022.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0022.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0023.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0023.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0023.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0023.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0014.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0023.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0023.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0023.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0014.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0023.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0023.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0023.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0023.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0023.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0024.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0024.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0024.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0024.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0015.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0024.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0024.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0024.html From arnab.bhaumik at gmail.com Sat May 12 22:23:49 2007 From: arnab.bhaumik at gmail.com (arnab bhaumik) Date: Sun, 13 May 2007 09:53:49 +0530 Subject: [Rxtx] damm good rxtx Message-ID: hi trent, good work with rxtx........ i wrote a program for my project(java application and atmega8 board). it is working parfectly on different systems( x86 and x86-64 both). and also in xp and linux........ i just had to change the com port name..... one question i should ask..... because of the advanceness of usb port it is really a requirement to build projects with usb prot....... so any work around on usb in rxtx package in near future????? arnab/vu2bpw -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070513/630fb848/attachment-0015.html From tjarvi at qbang.org Sun May 13 08:56:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 13 May 2007 08:56:51 -0600 (MDT) Subject: [Rxtx] damm good rxtx In-Reply-To: References: Message-ID: On Sun, 13 May 2007, arnab bhaumik wrote: > hi trent, > > good work with rxtx........ i wrote a program for my project(java > application and atmega8 board). it is working parfectly on different > systems( x86 and x86-64 both). and also in xp and linux........ i just had > to change the com port name..... > > > one question i should ask..... because of the advanceness of usb port it > is really a requirement to build projects with usb prot....... > > so any work around on usb in rxtx package in near future????? > > > arnab/vu2bpw > There are no intentions of including USB support in rxtx at this time. We do support USB serial port dongles. USB is a different project and is included in JSR80 http://jcp.org/en/jsr/detail?id=80 -- Trent Jarvi tjarvi at qbang.org From support at kartmanager.de Mon May 14 08:43:08 2007 From: support at kartmanager.de (Andre Geisler) Date: Mon, 14 May 2007 16:43:08 +0200 Subject: [Rxtx] Problem on closing Ports Message-ID: <4648757C.8080601@kartmanager.de> Hello, i have got a small problem on closing serail ports. The following class manages the my serials connection an is handeled by an object calles kbn which lays in a java swin gui: public class Serial implements SerialPortEventListener{ private static CommPortIdentifier portId; private static Enumeration portList; private InputStream inputStream; private OutputStream outputStream; private SerialPort serialPort; private AmbHandler ambh = new AmbHandler(); private String defaultPort = "/dev/ttyS0"; private Kartbahnnutzung kbn; public Serial() {} public void connect(){ boolean portFound = false; 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; } } } if (!portFound) { System.out.println("port " + defaultPort + " not found."); } try { serialPort = (SerialPort) portId.open("Kartman Read Thread", 2000); } catch (PortInUseException e) {} try { inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } catch (IOException e) {} try { serialPort.addEventListener(this); } catch (TooManyListenersException e) {} serialPort.notifyOnDataAvailable(true); try { serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_2, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException 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: byte[] readBuffer =new byte[25]; int numBytes=0; try { while (inputStream.available() > 0) { numBytes = inputStream.read(readBuffer); System.out.println("String: "+ new String(readBuffer,0,numBytes)); System.out.println("Anzahl der bytes: "+numBytes); ambh.newMessage(new String(readBuffer,0,numBytes)); readBuffer = new byte[25]; } if(ambh.isPacketComplete()){ System.out.println("Complete packet? "+ambh.isPacketComplete()); kbn.addErgebnis(ambh.getLastPacket()); System.out.println("Letzte Nachricht:"+ambh.getLastPacket().getMessage()); } } catch (IOException e) {System.out.println("Ups!");} break; } } public void simpleWrite(char c){ try{ this.outputStream.write(c); }catch ( IOException e ){ e.printStackTrace(); } } public void disconnect(){ serialPort.removeEventListener(); serialPort.close(); System.out.println(defaultPort+" is closed!"); } public ArrayList getAmbArray(){ return ambh.getPacketarr(); } public void setKartbahnnutzung(Kartbahnnutzung kbn){ this.kbn=kbn; } } I have got a button called which closes the connection. Everything is ok, it is calling an method from kbn which calls serialcon.disconnect(); But there is also the possibility that the kbn object closes the connection it self. It uses the same function "serial.disconnect()". The function itself is startetd, but it does not close the connection. Nothing els happens, no exception, no ... The program stops, and else happens. Is there a better way to close this connection??? regards -- Mit freundlichen Gr??en Andr? Geisler http://www.kartmanager.de support at kartmanager.de From rithy8 at gmail.com Mon May 14 12:16:39 2007 From: rithy8 at gmail.com (rithy roth) Date: Mon, 14 May 2007 11:16:39 -0700 Subject: [Rxtx] please help on when read time out occurs Message-ID: <79e2547b0705141116q6138850sdb937a6fe74b5eb3@mail.gmail.com> Hi, I've been looking for some doc regarding what enableReceiveTimeout() is doing( which event is generated) when a read time out occurs. Also, I am not sure myself what to do in my code when a timeout happens. Could someone please help? Thanks ======================================== Here is a portion of my code: After opening my serial port, I issued the following: ... try { sPort.enableReceiveTimeout(30); } catch (UnsupportedCommOperationException e) { throw new SerialConnectionException("Enable Receive Timeout not supported"); } ... Then, on my read I just have a listener on event notification: public void serialEvent(SerialPortEvent e) { // Create a StringBuffer and int to receive input data. StringBuffer inputBuffer = new StringBuffer(); int newData = 0; // Determine type of event. switch (e.getEventType()) { // Read data until -1 is returned. If \r is received substitute // \n for correct newline handling. case SerialPortEvent.DATA_AVAILABLE: // System.out.println("data available"); while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } break; // If break event append BREAK RECEIVED message. case SerialPortEvent.BI: // messageAreaIn.append("\n--- BREAK RECEIVED ---\n"); Utils.debugprint("\n--- BREAK RECEIVED ---\n"); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070514/e5d9a4a8/attachment-0024.html From info at haberkamp.com Tue May 15 04:27:10 2007 From: info at haberkamp.com (Guido Haberkamp IT-Beratung) Date: Tue, 15 May 2007 12:27:10 +0200 Subject: [Rxtx] CommPortIdentifier "hangs" Message-ID: <46498AFE.7050307@haberkamp.com> Hello, I couldn't find a solution to my problem or even anybody else mentioning this problem on the net, so I'm asking you all for help. I'm trying to use rxtx2.1.7 But when I try to get the portId from CommPortIdentifier.getPortIdentifier("COM1") It takes 3min50sec for the method to return the value. After that everything works fine. Connecting via Hyperterminal to the same port shows no noticable delay I'll include my code at the end of this posting Thanks for your help. Guido Here some details to my programming environment: Windows 2000 Prof. IBM T23 with one built-in Comport ("COM1"), another one via USB-Serial Adapter (ATEN, COM5 or COM8) COM10-17 are assigned because of a VS Netcom Device that connects 8 Serial ports over one tcp/ip link Eclipse 3.2.2 Java 1.5.0 rxtx-2.1-7r2 I'm new to Java programming in general and serial port communication in particular, so I'd really appreciate also some hints if I use rxtx completely the wrong way. at Captain.at there's a code example that iterates through all available ports (including parallel ports), but that code gave me many strange exceptions, so I changed it to opening the required port directly. Here's my code: import gnu.io.CommPort; import gnu.io.CommPortIdentifier; import gnu.io.NoSuchPortException; import gnu.io.PortInUseException; import gnu.io.SerialPort; import gnu.io.SerialPortEvent; import gnu.io.SerialPortEventListener; import gnu.io.UnsupportedCommOperationException; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.util.Date; import java.util.Enumeration; import java.util.TooManyListenersException; import java.util.prefs.Preferences; import logic.Parser; /** * TODO Add comment here * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class SerialCommunicator implements SerialPortEventListener { static CommPortIdentifier portId = null; static Enumeration portList = null; String appName = null; private int baudRate = 0; private String device = null; // InputStream in = null; BufferedReader in = null; private String lineRead = null; OutputStream out = null; private Parser parser = null; private String portName = null; private Preferences prefs = null; public Thread readerThread = null; private SerialPort serialPort = null; int timeout = 0; public Thread writerThread = null; public SerialCommunicator(Parser p, Preferences pr, String dev) { super(); this.parser = p; this.prefs = pr; this.device = dev; // TODO: assertions p, pr, d != null Preferences node = prefs.node("General"); this.timeout = node.getInt("timeout", 0); node = prefs.node(device); this.portName = node.get("portName", null); this.baudRate = node.getInt("baudRate", 0); this.appName = node.get("appName", null); System.out.println("Trying to connect to port "+portName); Date date = new Date(); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); if (foundPort(portName)){ try { connect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } date = new Date(); System.out.println("Connected to port "+portName); System.out.println("at: "+date.getHours()+":"+date.getMinutes()+":"+date.getSeconds()); } else { System.out.println("Could not connect"); } } boolean foundPort (String port){ boolean portFound = false; try { // portId = CommPortIdentifier.getPortIdentifier(port); portId = CommPortIdentifier.getPortIdentifier("COM5"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } if ( portId.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { portFound = true; } return portFound; } void connect () throws Exception { this.openPort(portName); this.setInputStream(); this.setParameters(); } void openPort (String port){ try { serialPort = (SerialPort) portId.open(appName, timeout); } catch (PortInUseException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setInputStream (){ try { this.in = new BufferedReader(new InputStreamReader(this.serialPort.getInputStream())); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } serialPort.notifyOnDataAvailable(true); try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { // TODO Auto-generated catch block e.printStackTrace(); } } void setParameters(){ try { this.serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); } catch (UnsupportedCommOperationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } 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: try { this.lineRead = this.in.readLine(); System.out.println("Read: "+lineRead); } catch (IOException e) {} break; } } } -------------- next part -------------- A non-text attachment was scrubbed... Name: info.vcf Type: text/x-vcard Size: 317 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070515/810b538b/info-0024.vcf From murato at mobiliz.com.tr Wed May 16 06:58:50 2007 From: murato at mobiliz.com.tr (Murat Ozdemir) Date: Wed, 16 May 2007 15:58:50 +0300 Subject: [Rxtx] java.io.IOException: No error in nativeDrain Message-ID: Hello all, i'm using RXTX 2.1 with JSmsLib 2.1.0 When i'm trying to run that framework, i'm getting exceptions from RXTX Library as; java.io.IOException: No error in nativeDrain at gnu.io.RXTXPort.nativeDrain(Native Method) at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201) at org.smslib.CSerialDriver.send(CSerialDriver.java:206) at org.smslib.handler.CATHandler.sync(CATHandler.java:43) at org.smslib.CService.connect(CService.java:539) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.doIt(ReadMessagesAsync.java:92) at tr.com.mobiliz.commserver.blo.handler.serial.rs232.sms.examples.ReadMessages Async.main(ReadMessagesAsync.java:140) Also, when i've read the README for rxtxSerial.dll faced that; Wed Mar 1 12:01:05 MST 2006 rxtxSerial.dll had to be recomopiled to link in missing native methods. what should i do? How can i recompile the dll? --------------- Murat OZDEMiR -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/attachment-0024.html -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3736 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070516/938793aa/smime-0024.bin From Alec.Cawley at quantel.com Thu May 17 06:14:45 2007 From: Alec.Cawley at quantel.com (Alec.Cawley@quantel.com) Date: Thu, 17 May 2007 13:14:45 +0100 Subject: [Rxtx] Source or javadox for javax.comm API Message-ID: I want to access serial ports on Windows from Java. I get think I understand how to compile and run - put RXTXcomm.jar in my classpath, put the appropriate DLLs in the DLL search path. But what about me? How do I lean how to use it? There is no javax.comm in the api Javadoc with the JAVA SDK 6.1, and I can only find on-line javadoc for it. I would prefer not to be dependant on on-line resources *all* the time. Is there somewhere I can download javax.comm.java or a bundle of the Javadocs generated from it? Alec Cawley -- This e-mail is intended for the named addressees only. Its contents may be privileged or confidential and should be treated as such. If you are not an intended recipient please notify the sender immediately and then delete it; do not copy, distribute, or take any action based on this e-mail. In the pursuit of its legitimate business activities and its conformance with relevant legislation, Quantel may access any e-mail (including attachments) it originates or receives, for potential scrutiny. Quantel is the trade name used by Quantel Holdings Limited and its subsidiaries. Quantel Holdings Limited is registered in England & Wales. Registration No: 4004913 Contact details for all Quantel Offices and Companies can be found on our website www.quantel.com or by writing to the holding company. Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United Kingdom From h.mayer at inode.at Sat May 19 10:01:39 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 18:01:39 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter Message-ID: <464F1F63.4020302@inode.at> Hi all! I was testing my new USB-to-Serial converter with the SimpleRead.java application, but it hangs with 100% cpu. I also have an own app, which sends a string and tries to receive it. I use a null-modem - while sending works (I can see the string with "cat /dev/ttyUSB0"), the serialEvent is not fired and 100% cpu is the result. Doing the same (sending a string and receiving) with some C code works. Has anyone see the same behaviour and is there a fix somewhere ? Thanks! Cheers, Hannes. From h.mayer at inode.at Sat May 19 12:36:57 2007 From: h.mayer at inode.at (Hannes Mayer) Date: Sat, 19 May 2007 20:36:57 +0200 Subject: [Rxtx] RXTX hangs (100% cpu) when using USB-to-Serial converter In-Reply-To: <464F1F63.4020302@inode.at> References: <464F1F63.4020302@inode.at> Message-ID: <464F43C9.2000003@inode.at> Hannes Mayer wrote: > Hi all! > > I was testing my new USB-to-Serial converter with the > SimpleRead.java application, but it hangs with 100% > cpu. Found the problem! Removing serialPort.notifyOnOutputEmpty(true); resolves this issue. It seems that the usbserial driver doesn't support this. Cheers, Hannes. From lists at iDIAcomputing.com Sun May 20 17:59:11 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 19:59:11 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes Message-ID: <4650E0CF.8040900@iDIAcomputing.com> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which has no data available, I get java.io.IOException: Underlying input stream returned zero bytes at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) This is using code that worked fine with Sun's javax.comm API (the old 2.0 version) until a JVM upgrade broke it. Any suggestions on what's wrong? I'd dig into it deeper, but I don't have a C compiler on this box. As near as I can tell from reading the Java source, this means the open() call didn't grab a file descriptor. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From tjarvi at qbang.org Sun May 20 18:08:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 20 May 2007 18:08:39 -0600 (MDT) Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: <4650E0CF.8040900@iDIAcomputing.com> References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: On Sun, 20 May 2007, George Dinwiddie wrote: > Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which > has no data available, I get > java.io.IOException: Underlying input stream returned zero bytes > at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) > > This is using code that worked fine with Sun's javax.comm API (the old > 2.0 version) until a JVM upgrade broke it. > > Any suggestions on what's wrong? I'd dig into it deeper, but I don't > have a C compiler on this box. As near as I can tell from reading the > Java source, this means the open() call didn't grab a file descriptor. > > - George > > Hi George, Perhaps changing the threshold and or timeout may result in the behavior you expect. -- Trent Jarvi tjarvi at qbang.org From lists at iDIAcomputing.com Sun May 20 18:51:25 2007 From: lists at iDIAcomputing.com (George Dinwiddie) Date: Sun, 20 May 2007 20:51:25 -0400 Subject: [Rxtx] Underlying input stream returned zero bytes In-Reply-To: References: <4650E0CF.8040900@iDIAcomputing.com> Message-ID: <4650ED0D.9000204@iDIAcomputing.com> Trent Jarvi wrote: > On Sun, 20 May 2007, George Dinwiddie wrote: > >> Uxing RXTX-2.1-7 on Windows XP Pro: when I try to read from a port which >> has no data available, I get >> java.io.IOException: Underlying input stream returned zero bytes >> at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(Unknown Source) >> >> This is using code that worked fine with Sun's javax.comm API (the old >> 2.0 version) until a JVM upgrade broke it. >> >> Any suggestions on what's wrong? I'd dig into it deeper, but I don't >> have a C compiler on this box. As near as I can tell from reading the >> Java source, this means the open() call didn't grab a file descriptor. >> >> - George >> >> > > Hi George, > > Perhaps changing the threshold and or timeout may result in the behavior > you expect. Thanks, Trent. Any suggestions on values? BTW, The javax.comm 2.0 library seems to enable the timeout when opened as: CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( serialPortParams.getPortName()); int timeout = 60000; serialPort = (SerialPort) portId.open(processname, timeout); When I serialPort.enableReceiveTimeout(timeout); serialPort.enableReceiveThreshold(1); I don't seem to receive any characters. - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- From netbeans at gatworks.com Thu May 24 06:38:55 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 08:38:55 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() Message-ID: <4655875F.7000409@gatworks.com> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. 2) ./configure 3) make 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 5) moved .libs/*.so to /usr/local/RXTX/2.1 then run project: > > RXTXCommDriver {} > java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion()Ljava/lang/String; thrown while loading gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > SerialPort_NMEA_GNU:SerialPort_NMEA_GNU > java.lang.NoClassDefFoundError: Could not initialize class gnu.io.RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver > GpsData_Device: jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > NoClassDefFoundError javax/comm/SerialPortEventListener > GpsData_Device: ignoring jGPS/GpsData/DeviceDrivers/SerialPort/SerialPort_NMEA.class > BinaryDriver.open(); Unable to open/locate /dev/ttyUSB0 After a lot of *&$#&$@&$^ I saw that there is no nativeGetVersion() in librxtxSerial.so. seems like the linker failed. seems like the -rpath got the wrong path seems like RXTX_PATH failed to get set. seems like configure.in/configure does not check for java 1.6! > 1.2*|1.3*|1.4*|1.5*) > #fix_parameters $JPATH/jre/lib/javax.comm.properties > CLASSPATH=".:\$(TOP):\$(TOP)/src:"`find $JPATH/ -name RXTXcomm.jar |head -n1` > JHOME=$JPATH"/jre/lib/ext" > RXTX_PATH="\$(JPATH)/jre/lib/\$(OS_ARCH)" > ;; seems like there is no error if RXTX_PATH is not set :{ From Steffen.DETTMER at ingenico.com Thu May 24 08:22:46 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 24 May 2007 16:22:46 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655875F.7000409@gatworks.com> References: <4655875F.7000409@gatworks.com> Message-ID: <20070524142246.GP13517@elberon.bln.de.ingenico.com> Hi! * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: > 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. > 2) ./configure > 3) make > 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 > 5) moved .libs/*.so to /usr/local/RXTX/2.1 I'm not sure for what platforms autoconf is supported, I think in some README there is Makefile.mingw32 suggested. With a few changes the makefile worked but I needed to invoke make multiple times. I'm busy right now but I give you my notes just in case it helps. I do a copy&paste so don't wonder :) ------------------------------------------------------------------->8======= Notes about rxtx building (windows). extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ in Makefile, fix: - JDKHOME=$(JAVA_HOME) - MINGHOME="c:/MinGW" - COMMINSTALL="d:\home\steffen\tmp\rxtx" - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" - LIBDIR="c:\MinGW\lib" - I commented out $(SRC)/Zystem.def: rule - # rxtxZystem.dll - in target install: xcopy needs /y or so, I used: xcopy /Y *.dll $(LIBINSTALL) with limited success :-) use a cmd.exe shell. Neither cygwin nor mingw shells will work! Have path to c:\mingw\bin: gcc.exe --version gcc.exe (GCC) 3.4.2 (mingw-special) D:\>cd /home/steffen/work/rxtx-2.1-7r2/build D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install best to make multiple times, at least two, to make it work, otherwise the DLL will miss some symbols! here what seems to usually work: $ del *.o *.dll $ mingw32-make -f Makefile.mingw32 clean $ mingw32-make -f Makefile.mingw32 $ mingw32-make -f Makefile.mingw32 install $ touch ..\src\SerialImp.c $ mingw32-make -f Makefile.mingw32 install If the DLL is build incomplete, you get NO ERROR! So you need to test the DLL! =======8<------------------------------------------------------------------- here a diff of the Makefile (just to indicate where you probably need to change something) ------------------------------------------------------------------->8======= --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 @@ -36,19 +36,26 @@ DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path -JDKHOME=C:/jdk13 +# JDKHOME=C:/jdk13 +# C:\Programme\Java\jdk1.5.0_04 +JDKHOME=$(JAVA_HOME) #path to mingw32 -MINGHOME="D:/mingw" +# MINGHOME="D:/mingw" +MINGHOME="c:/MinGW" # path to install RXTXcomm.jar DOS style path -COMMINSTALL="C:\jdk13\lib" +# COMMINSTALL="C:\jdk13\lib" +COMMINSTALL="d:\home\steffen\tmp\rxtx" # path to install the shared libraries DOS style path -LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="C:\jdk13\bin" +# LIBINSTALL="d:\home\steffen\tmp\rxtx" +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path -LIBDIR="c:\cygwin\lib\mingw" +# LIBDIR="c:\cygwin\lib\mingw" +LIBDIR="c:\MinGW\lib" ###################### # End of user defined variables @@ -76,8 +83,8 @@ ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll @@ -137,8 +144,8 @@ # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) @@ -215,10 +222,12 @@ echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all - xcopy RXTXcomm.jar $(COMMINSTALL) - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" - xcopy $(TARGETLIBS) $(LIBINSTALL) - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" + xcopy /Y RXTXcomm.jar $(COMMINSTALL) + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" + rem xcopy $(TARGETLIBS) $(LIBINSTALL) + xcopy /Y *.dll $(LIBINSTALL) + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar =======8<------------------------------------------------------------------- oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Thu May 24 09:12:47 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:12:47 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070524142246.GP13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> Message-ID: <4655AB6F.1000908@gatworks.com> This is linux. the configure script only goes up to jdk1.5 :( I use jdk1.6 :) Steffen DETTMER wrote: > Hi! > > * Uncle George wrote on Thu, May 24, 2007 at 08:38 -0400: >> 1) I got rxtx-2.1-7r2.zip, which I suppose is the last official release. >> 2) ./configure >> 3) make >> 4) moved RXTXcomm.jar to /usr/local/RXTX/2.1 >> 5) moved .libs/*.so to /usr/local/RXTX/2.1 > > I'm not sure for what platforms autoconf is supported, I think in > some README there is Makefile.mingw32 suggested. > > With a few changes the makefile worked but I needed to invoke > make multiple times. I'm busy right now but I give you my notes > just in case it helps. I do a copy&paste so don't wonder :) > > ------------------------------------------------------------------->8======= > Notes about rxtx building (windows). > > extract rxtx-2.1-7r2. copy Makefile.mingw32 to directory build/ > in Makefile, fix: > - JDKHOME=$(JAVA_HOME) > - MINGHOME="c:/MinGW" > - COMMINSTALL="d:\home\steffen\tmp\rxtx" > - LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > - LIBDIR="c:\MinGW\lib" > - I commented out $(SRC)/Zystem.def: rule > - # rxtxZystem.dll > - in target install: xcopy needs /y or so, I used: > xcopy /Y *.dll $(LIBINSTALL) > with limited success :-) > > use a cmd.exe shell. Neither cygwin nor mingw shells will work! > Have path to c:\mingw\bin: > gcc.exe --version > gcc.exe (GCC) 3.4.2 (mingw-special) > D:\>cd /home/steffen/work/rxtx-2.1-7r2/build > D:\home\steffen\work\rxtx-2.1-7r2\build>mingw32-make.exe -f Makefile.mingw32 install > > best to make multiple times, at least two, to make it work, > otherwise the DLL will miss some symbols! > > here what seems to usually work: > > $ del *.o *.dll > $ mingw32-make -f Makefile.mingw32 clean > $ mingw32-make -f Makefile.mingw32 > $ mingw32-make -f Makefile.mingw32 install > $ touch ..\src\SerialImp.c > $ mingw32-make -f Makefile.mingw32 install > > If the DLL is build incomplete, you get NO ERROR! So you need to > test the DLL! > =======8<------------------------------------------------------------------- > > > here a diff of the Makefile (just to indicate where you probably > need to change something) > > > ------------------------------------------------------------------->8======= > --- rxtx-2.1-7r2.dist/Makefile.mingw32 2004-10-12 10:59:26.000000000 +0200 > +++ rxtx-2.1-7r2/build/Makefile.mingw32 2007-04-20 13:12:24.292312900 +0200 > @@ -36,19 +36,26 @@ > DOSSRC=..\\\src > > # path to the jdk directory that has include, bin, lib, ... Unix style path > -JDKHOME=C:/jdk13 > +# JDKHOME=C:/jdk13 > +# C:\Programme\Java\jdk1.5.0_04 > +JDKHOME=$(JAVA_HOME) > > #path to mingw32 > -MINGHOME="D:/mingw" > +# MINGHOME="D:/mingw" > +MINGHOME="c:/MinGW" > > # path to install RXTXcomm.jar DOS style path > -COMMINSTALL="C:\jdk13\lib" > +# COMMINSTALL="C:\jdk13\lib" > +COMMINSTALL="d:\home\steffen\tmp\rxtx" > > # path to install the shared libraries DOS style path > -LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="C:\jdk13\bin" > +# LIBINSTALL="d:\home\steffen\tmp\rxtx" > +LIBINSTALL="d:\home\steffen\work\jxx_sys\j++\lib" > > # path to the mingw32 libraries (directory with libmingw32.a) DOS style path > -LIBDIR="c:\cygwin\lib\mingw" > +# LIBDIR="c:\cygwin\lib\mingw" > +LIBDIR="c:\MinGW\lib" > > ###################### > # End of user defined variables > @@ -76,8 +83,8 @@ > ###################### > > CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > -#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS > +#CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall > +CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -DTRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS -DTRENT_IS_HERE -DDEBUG -DDEBUG_VERBOSE > INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) > JAVAHFLAGS= -jni -d include > LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll > @@ -137,8 +144,8 @@ > # need to install cygwin. > > #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o > - #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > - #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > + rem # $(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 > + rem # xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ > > > $(SRC)/Serial.def: $(DLLOBJECTS) > @@ -215,10 +222,12 @@ > echo "#undef HAVE_TERMIOS_H" >> include\\\config.h > > install: all > - xcopy RXTXcomm.jar $(COMMINSTALL) > - xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > - xcopy $(TARGETLIBS) $(LIBINSTALL) > - xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > + xcopy /Y RXTXcomm.jar $(COMMINSTALL) > + xcopy /Y RXTXcomm.jar $(LIBINSTALL)\rxtxcomm.jar > + rem xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" > + rem xcopy $(TARGETLIBS) $(LIBINSTALL) > + xcopy /Y *.dll $(LIBINSTALL) > + rem xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" > > uninstall: > del $(COMMINSTALL)\\\RXTXcomm.jar > =======8<------------------------------------------------------------------- > > > oki, > > Steffen > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. > www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From netbeans at gatworks.com Thu May 24 09:37:14 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 24 May 2007 11:37:14 -0400 Subject: [Rxtx] ioctl( GETLSR ) Message-ID: <4655B12A.6020007@gatworks.com> It seems the IFDEF'ng TIOCSERGETLSR is not exactly a great idea. the ability to get a reply on an ioctl request is dependant on the device driver. One device may have the ability to give an answer to the ioctl, and another device may not even have that capability. So if a device has that capability, then call the ioctl. If it does not have that capability process it with the alternate code. This has to be runtime determined, rather that statically pre-defined at compile time. > /*---------------------------------------------------------- > check_line_status_register > > accept: event_info_struct > perform: check for changes on the LSR > return: 0 on success > exceptions: none > comments: not supported on all devices/drivers. > ----------------------------------------------------------*/ > int check_line_status_register( struct event_info_struct *eis ) > { > if( eis->has_tiocsergetlsr ) > return check_line_status_register_with_GETLSR( struct event_info_struct *eis ); > > return check_line_status_register_without_GETLSR( struct event_info_struct *eis ); > } > From frans_nieuwerth at nl.ibm.com Thu May 24 12:03:15 2007 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Thu, 24 May 2007 20:03:15 +0200 Subject: [Rxtx] Frans Nieuwerth/Netherlands/IBM is out of the office. Message-ID: I will be out of the office starting 16-05-2007 and will not return until 25-05-2007. I will be out of the office until May 25 for vacation and a business trip. I will have limited access to email and voicemail in this period. For questions/issues around Philips/NXP, you can contact Danny Spits (Software Account Manager) . For ABP contact Mai Vu or Hanko van Giessen. Leave me an SMS or voicemail at +31 6 2292 5490 in case you need to reach me for urgent matters. See you on May 25, Frans Nieuwerth From Steffen.DETTMER at ingenico.com Fri May 25 01:05:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Fri, 25 May 2007 09:05:01 +0200 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <4655AB6F.1000908@gatworks.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> Message-ID: <20070525070501.GU13517@elberon.bln.de.ingenico.com> * Uncle George wrote on Thu, May 24, 2007 at 11:12 -0400: > This is linux. yes, sorry, I confused your mail with another one :) > the configure script only goes up to jdk1.5 :( > I use jdk1.6 :) Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? oki, Steffen About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Fri May 25 02:52:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 04:52:02 -0400 Subject: [Rxtx] Linux: UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion() In-Reply-To: <20070525070501.GU13517@elberon.bln.de.ingenico.com> References: <4655875F.7000409@gatworks.com> <20070524142246.GP13517@elberon.bln.de.ingenico.com> <4655AB6F.1000908@gatworks.com> <20070525070501.GU13517@elberon.bln.de.ingenico.com> Message-ID: <4656A3B2.3030901@gatworks.com> Steffen DETTMER wrote: >> the configure script only goes up to jdk1.5 :( >> I use jdk1.6 :) > > Shouldn't the jar compiled with jdk-1.5 work with jdk-1.6? yes it should. I compile from source. The garmin_gps kernel driver for a USB garmin gps receiver does not have ioctl() functionality, and causes stock rxtx to fail horribly if the generic version is used. From netbeans at gatworks.com Fri May 25 06:56:09 2007 From: netbeans at gatworks.com (Uncle George) Date: Fri, 25 May 2007 08:56:09 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? Message-ID: <4656DCE9.5050008@gatworks.com> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how many characters are available, I get the following exception :{ > java.io.IOException: Input/output error in nativeavailable > at gnu.io.RXTXPort.nativeavailable(Native Method) > at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) > at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) > at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) > at gnu.io.RXTXPort.eventLoop(Native Method) > at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) There is no more data available. I pulled the USB cable out of the hub. I dont THINK i should have gotten the data_available event. BUt not sure yet what eventLoop() checks are done, and what, if any, events are generated if the device is unplugged. any thoughts? From tjarvi at qbang.org Fri May 25 21:03:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 25 May 2007 21:03:15 -0600 (MDT) Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: <4656DCE9.5050008@gatworks.com> References: <4656DCE9.5050008@gatworks.com> Message-ID: On Fri, 25 May 2007, Uncle George wrote: > I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how > many characters are available, I get the following exception :{ > >> java.io.IOException: Input/output error in nativeavailable >> at gnu.io.RXTXPort.nativeavailable(Native Method) >> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >> at gnu.io.RXTXPort.eventLoop(Native Method) >> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) > > There is no more data available. I pulled the USB cable out of the hub. > > I dont THINK i should have gotten the data_available event. BUt not sure > yet what eventLoop() checks are done, and what, if any, events are > generated if the device is unplugged. > > any thoughts? Hi George, With the current implementation of rxtx, you really are out of luck when the cable is pulled. This is even worse with bluetooth that may vanish and come back. There isnt a good way to catch when the serial port vanishes through termios. I don't know of any API short of USB that really can catch the events. That said, rxtx bails in an ugly fashion right now. The File Descriptor goes sour and then the event loop pukes. The only fix I have in the pipe is catching exceptions when flush fails with bluetooth. In the short term, it appears a glue gun is the best solution :) -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Fri May 25 22:05:57 2007 From: netbeans at gatworks.com (Uncle George) Date: Sat, 26 May 2007 00:05:57 -0400 Subject: [Rxtx] bogus SerialPortEvent.DATA_AVAILABLE event ? In-Reply-To: References: <4656DCE9.5050008@gatworks.com> Message-ID: <4657B225.7@gatworks.com> Well, pulling the plug on a serial port is a bit different than that of a USB/serial port. In either case, there are a lot of IOCTL's that now fail. There seems to be some mistakes in the code, where the ioctl failed, yet the code still think char count is valid. a :{ nativeavailable() also returns a -1 when the ioctl fails. Yet the folks who call the code ignore the -1 return value. also a :{ I need to see what SELECT does when device is pulled. As there should be a condition to effectively close the channel, and let user know that I/O error has happened. More research at what is happening. Trent Jarvi wrote: > On Fri, 25 May 2007, Uncle George wrote: > >> I got a SerialPortEvent.DATA_AVAILABLE event. But when I check out how >> many characters are available, I get the following exception :{ >> >>> java.io.IOException: Input/output error in nativeavailable >>> at gnu.io.RXTXPort.nativeavailable(Native Method) >>> at gnu.io.RXTXPort$SerialInputStream.available(RXTXPort.java:1532) >>> at jGPS.GpsData.DeviceDrivers.UsbPort.UsbPort_Binary.serialEvent(UsbPort_Binary.java:551) >>> at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732) >>> at gnu.io.RXTXPort.eventLoop(Native Method) >>> at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1575) >> There is no more data available. I pulled the USB cable out of the hub. >> >> I dont THINK i should have gotten the data_available event. BUt not sure >> yet what eventLoop() checks are done, and what, if any, events are >> generated if the device is unplugged. >> >> any thoughts? > > Hi George, > > With the current implementation of rxtx, you really are out of luck when > the cable is pulled. This is even worse with bluetooth that may vanish > and come back. > > There isnt a good way to catch when the serial port vanishes through > termios. I don't know of any API short of USB that really can catch the > events. > > That said, rxtx bails in an ugly fashion right now. The File Descriptor > goes sour and then the event loop pukes. > > The only fix I have in the pipe is catching exceptions when flush fails > with bluetooth. In the short term, it appears a glue gun is the best > solution :) > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From tjarvi at qbang.org Tue May 29 08:06:33 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 29 May 2007 08:06:33 -0600 (MDT) Subject: [Rxtx] RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx (fwd) Message-ID: FreeBSD port support patch. ---------- Forwarded message ---------- Date: Tue, 29 May 2007 12:15:31 +0200 From: Olivier Fauchon To: peter at no-nonsense.org Cc: yuenping at semiotek.com, taj at www.linux.org.uk Subject: RXTX FreeBSD support /dev/cuad00 /dev/cuaUxx Hi, You'll find a patch attached This patch allow the use of /dev/cuadXX and /dev/cuaUxx serial devices on FreeBSD. Hope you will include that on the next release. Thanks for your work ! NB: I run - FreeBSD 6.2-STABLE - ports/comms/rxtx/work/rxtx-2.1-7r2 -- Olivier Fauchon Data & Mobiles Tel: +33(0)4.42.77.08.93 Gsm: +33(0)6.82.64.76.69 http://www.data-mobiles.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: RXTX_freebsd_patch.patch Type: text/x-patch Size: 642 bytes Desc: Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070529/6d4d79d4/RXTX_freebsd_patch-0024.bin From netbeans at gatworks.com Thu May 31 06:49:40 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 08:49:40 -0400 Subject: [Rxtx] Serial port events & hard I/O error. Message-ID: <465EC464.1000405@gatworks.com> It seems like u are not suppose to get a serialportevent if the device has some sort of hardware error ( ie pull out the USB cable ). is this correct? From netbeans at gatworks.com Thu May 31 14:48:46 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 16:48:46 -0400 Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? Message-ID: <465F34AE.3090504@gatworks.com> Like for the following example: +#ifdef DEBUG + { char buf[200]; + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, errno=%d (%s)\n", + line, msg, err, strerror( err ) ); + report( buf ); + } +#endif From netbeans at gatworks.com Thu May 31 15:46:02 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 17:46:02 -0400 Subject: [Rxtx] The SELECT() that never stops giving! Message-ID: <465F421A.2070005@gatworks.com> in SerialImp.c:RXTXPort(eventLoop) there is a select: > eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, > &eis.tv_sleep ); that will always return 1 if your USB device is suddenly disconnected, or turned off. In my case, i test the code by disconnecting the USB from the hub. Later on, there is a call to "port_has_changed_fionread( eis )" which fails with a serious I/O error ( usb no connected anymore ) , but is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in buffer ). Since there no characters to be read, it returns to the SELECT loop. The SELECT then gets called, and immediately returns with a 1. Of which the fionread() is processed again, and finds no characters in the buffer, and returns to do the SELECT again. This just spins. and spins and ...... The only way to get out of the "eventloop" appears to be by setting the eis->closing flag. This appears to stop she spin. It also stops any further SerialEvents. Which is OK, as it is probably not easy to get the USB/kernel-driver to continue from where it was disconnected. Any gotcha's? From tjarvi at qbang.org Thu May 31 17:59:32 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 17:59:32 -0600 (MDT) Subject: [Rxtx] Whats the proper #ifdef for DEBUG tracing? In-Reply-To: <465F34AE.3090504@gatworks.com> References: <465F34AE.3090504@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > Like for the following example: > > +#ifdef DEBUG > + { char buf[200]; > + snprinf(buf, sizeof(buf), "(%d) SYScall failure for %s, > errno=%d (%s)\n", > + line, msg, err, strerror( err ) ); > + report( buf ); > + } > +#endif Hi George, With the ifdefs, I found that a generic solution is usually not suitable. If you are debugging something outside of the eventloop, DEBUG is fine. You will probably see debug ifdefs that related to the eventloop with 'TRENT_IS_HERE' and debugging inside of MATLAB. If you are debugging the filedescriptors going bad with bluetooth/USB dongles, you may want a DEBUG_FD flag for instance and just | that with others you want to use that are already there. Some of the debug statments can generate megs of log info in notime. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:03:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:03:04 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F421A.2070005@gatworks.com> References: <465F421A.2070005@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > in SerialImp.c:RXTXPort(eventLoop) there is a select: >> eis.ret = SELECT( eis.fd + 1, &eis.rfds, NULL, NULL, >> &eis.tv_sleep ); > > that will always return 1 if your USB device is suddenly disconnected, > or turned off. In my case, i test the code by disconnecting the USB from > the hub. Later on, there is a call to "port_has_changed_fionread( eis )" > which fails with a serious I/O error ( usb no connected anymore ) , but > is only allowed to return a 0 ( no chars in buffer) or 1 ( chars in > buffer ). > Since there no characters to be read, it returns to the SELECT loop. The > SELECT then gets called, and immediately returns with a 1. Of which the > fionread() is processed again, and finds no characters in the buffer, > and returns to do the SELECT again. > > This just spins. and spins and ...... > > The only way to get out of the "eventloop" appears to be by setting the > eis->closing flag. This appears to stop she spin. It also stops any > further SerialEvents. Which is OK, as it is probably not easy to get the > USB/kernel-driver to continue from where it was disconnected. > > Any gotcha's? > Just some thoughts... The application needs to know that the device was unplugged. Read and write need to exit gracefully. Bluetooth may disappear and come back due to a noisy environment. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Thu May 31 18:04:14 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:04:14 -0600 (MDT) Subject: [Rxtx] Serial port events & hard I/O error. In-Reply-To: <465EC464.1000405@gatworks.com> References: <465EC464.1000405@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: > It seems like u are not suppose to get a serialportevent if the device > has some sort of hardware error ( ie pull out the USB cable ). > is this correct? > That is correct but perhaps outdated for CommAPI which predates usb dongles. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 18:24:19 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 20:24:19 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> Message-ID: <465F6733.4030404@gatworks.com> > Just some thoughts... > > The application needs to know that the device was unplugged. As far as I can tell, no can do. > Read and write need to exit gracefully. it appears that read/write give java IOException events. which is :} > Bluetooth may disappear and come back due to a noisy environment. the problem is what does the device driver do? and what does the user program see? Will the fionread recover? Will the select recover? I just cant have the rxtx.eventloop spin. From tjarvi at qbang.org Thu May 31 18:54:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 31 May 2007 18:54:11 -0600 (MDT) Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: <465F6733.4030404@gatworks.com> References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: On Thu, 31 May 2007, Uncle George wrote: >> Just some thoughts... >> >> The application needs to know that the device was unplugged. > As far as I can tell, no can do. >> Read and write need to exit gracefully. > it appears that read/write give java IOException events. which is :} > >> Bluetooth may disappear and come back due to a noisy environment. > the problem is what does the device driver do? > and what does the user program see? > Will the fionread recover? > Will the select recover? > > I just cant have the rxtx.eventloop spin. What if we created a new exception for this. PortUpAndGoneVanishedException or something along those lines. Besides exiting, the eventLoop could set the fd to an invalid state to let RXTXPort.java that the serial port has left the house. Calls could trigger exceptions based upon the state of the fd. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Thu May 31 19:23:30 2007 From: netbeans at gatworks.com (Uncle George) Date: Thu, 31 May 2007 21:23:30 -0400 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7512.2010101@gatworks.com> Trent Jarvi wrote: > > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. There is no way to test for a vanished device. U get a hard I/O error. Maybe you recover, maybe you dont. In either case, I dont think that an exception from eventloop should be issued. BUT u still have to disarm the SELECT, as it will always sucessfully return for that 'disconnected device'. The select just wont tell you that a device has a serious issue. The next call after the SELECT is the FIONREAD to check out how many chars are left. In this scenario, the ioctl(FIONREAD) fails with a -1, and errno set to I/O error. If the eventloop is to be kept alive, then a sleep has to be issued, before the next SELECT is issued. If you dont want it alive, then set the closing flag. I seem to be leaning to the sleep() on the chance that the device can be plugged back in, and the device driver recovers. But then the device needs to be reinitialized, as the usb device lost its power. So does, generally speaking, one keep on reading if you get an I/O error, or do u close() up shop, and try opening again. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > tjarvi at qbang.org > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From naranjo.manuel at gmail.com Thu May 31 19:48:13 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Thu, 31 May 2007 22:48:13 -0300 Subject: [Rxtx] The SELECT() that never stops giving! In-Reply-To: References: <465F421A.2070005@gatworks.com> <465F6733.4030404@gatworks.com> Message-ID: <465F7ADD.1010501@gmail.com> > What if we created a new exception for this. > PortUpAndGoneVanishedException or something along those lines. > > Besides exiting, the eventLoop could set the fd to an invalid state to let > RXTXPort.java that the serial port has left the house. Calls could > trigger exceptions based upon the state of the fd. > > -- > Trent Jarvi > I don't know the case for other systems than Linux. But I had wrote a module for linux (which is included in the kernel so it has passed the standards from the kernel team), which is an extension to the usbserial module (actually all the USB<->Serial modules uses it to avoid handling low level tty and very low level usb). In the case of my module, you can unplug the device but it will not delete the symlink until those apps that had opened the port has closed it. This is done this way to avoid kernel panics. I had seen Windows panic when I unplugged the USB-Serial adapter was unplugged while data was being streamed. Cheers, Manuel From j.kenneth.gentle at acm.org Tue May 1 06:15:05 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 08:15:05 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705011215.l41CF9jc001914@qbang.org> Hello all! I've developed an app for a client targeting the Windows XP/Embedded environment. I'm using the JRE for Windows XP/Embedded from Sun (a J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and rxtxSerial.dll are in the correct places. I don't install the rxtxParallel.dll. Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the other Windows 2000 Pro), install the application with the Win XP/Embedded JRE and the two devices communicate wonderfully over a null modem cable. Unfortunately, I work remotely (about 900 miles) from my client and don't have immediate access to an XP/Embedded box. When he installs the software on two Windows XP/Embedded devices and tries to start up the application, the following error is recorded: SerialWireless Configuration loaded from "C:\Program Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" getSerialPort(): attempting to open serial port "COM3". java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries thrown while loading gnu.io.RXTXCommDriver com.gentlesoftware.serialwireless.SerialWirelessException: Unanticipated Exception at com.gentlesoftware.serialwireless.Master.start(Unknown Source) at com.gentlesoftware.serialwireless.Master.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't find dependent libraries at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) at java.lang.Runtime.loadLibrary0(Runtime.java:822) at java.lang.System.loadLibrary(System.java:992) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) at com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown Source) ... 8 more 1) Has anyone run into a similar problem? 2) My Windows C/C++ is very rusty - can someone point me at the link dependencies for Win32? I might be able to see what is missing in the Embedded environment that is present in the "desktop" environment. Thanks in advance! Ken Gentle From tommy at mail.convergent-design.com Tue May 1 11:35:24 2007 From: tommy at mail.convergent-design.com (Tommy Schell) Date: Tue, 1 May 2007 11:35:24 -0600 Subject: [Rxtx] USB using RXTX Message-ID: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Hi, Am I correct in assuming that RXTX can be used to communicate with a standard USB device that follows one of the USB device class specifications? In my case I want to send commands back and forth to a device which (I believe) will follow the USB communication class specs, appearing as a modem on the USB port. Basically I want to be able to update the firmware on the device, by sending various control commands and chunks of data to the device and then get appropriate responses, over USB. Is this possible with RXTX on the mac and pc? From perusing the archives this appears to be the case, but I'm not sure. As far as I know the low level drivers already exist on the mac and pc for USB communication class devices, it is just a matter of accessing them from user space (with java preferably), which RXTX appears to be able to do. Can the dll and jnilib associated with RXTX talk to specified pre-existing USB low level drivers? Also I'm not clear about the documentation for the java classes in RXTX. I noticed in an archive email that the Java commAPI JavaDocs is what is recommended? And is it a bad idea to install RXTX on a pc that already has javax.comm? I think I saw this mentioned in the archives. And then this is probably asking too much but is there any sample code out there for communicating with a USB device with RXTX? Thanks a lot ! Any advice is greatly appreciated. Tommy Schell From tjarvi at qbang.org Tue May 1 19:09:24 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:09:24 -0600 (MDT) Subject: [Rxtx] USB using RXTX In-Reply-To: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> References: <5E85CB80-078A-4620-895F-E4E0210E0386@mail.convergent-design.com> Message-ID: On Tue, 1 May 2007, Tommy Schell wrote: > Hi, > > Am I correct in assuming that RXTX can be used to > communicate with a standard USB device that follows > one of the USB device class specifications? > > > In my case I want to send commands back and forth to > a device which (I believe) will follow the USB communication > class specs, appearing as a modem on the USB port. > > Basically I want to be able to update the firmware on the device, > by sending various control commands and chunks of data to the > device and then get appropriate responses, over USB. > > > Is this possible with RXTX on the mac and pc? > From perusing the archives this appears to be the case, but I'm not > sure. > > As far as I know the low level drivers already exist on the mac > and pc for USB communication class devices, it is just > a matter of accessing them from user space (with java preferably), > which RXTX appears > to be able to do. > Can the dll and jnilib associated with RXTX talk > to specified pre-existing USB low level drivers? > > > Also I'm not clear about the documentation for the java classes > in RXTX. I noticed in an archive email that the Java commAPI > JavaDocs is what is recommended? > > And is it a bad idea to install RXTX on a pc that already has > javax.comm? > I think I saw this mentioned in the archives. > > And then this is probably asking too much but is there any > sample code out there for communicating with a USB device with RXTX? > > Hi Tommy rxtx is looking for traditional serial ports. Some USB devices have kernel drivers that allow them to appear as a serial port. If you want to talk USB you should investigate JSR80. That can communicate at lower levels. The Sun javax.com version 2 will work with rxtx 2.0 but thats more of an exercise than anything now. RXTX 2.1 and Sun CommAPI 3.0 are no longer synergistic and are in different namespaces. rxtx continues to follow the Sun CommAPI 2 javadocs with few and documented [in the source] exceptions. There are examples in the contrib directory but it sounds like you may be looking for the functionality of JSR80 which does have a reference implementation on Linux and possibly other systems now. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue May 1 19:27:50 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 1 May 2007 19:27:50 -0600 (MDT) Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded In-Reply-To: <200705011215.l41CF9jc001914@qbang.org> References: <200705011215.l41CF9jc001914@qbang.org> Message-ID: On Tue, 1 May 2007, Ken Gentle wrote: > Hello all! > > I've developed an app for a client targeting the Windows XP/Embedded > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > rxtxSerial.dll are in the correct places. I don't install the > rxtxParallel.dll. > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > other Windows 2000 Pro), install the application with the Win > XP/Embedded JRE and the two devices communicate wonderfully over a > null modem cable. > > Unfortunately, I work remotely (about 900 miles) from my client and > don't have immediate access to an XP/Embedded box. > > When he installs the software on two Windows XP/Embedded devices and > tries to start up the application, the following error is recorded: > > SerialWireless Configuration loaded from "C:\Program > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > getSerialPort(): attempting to open serial port "COM3". > java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > com.gentlesoftware.serialwireless.SerialWirelessException: > Unanticipated Exception > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > at java.lang.Thread.run(Thread.java:595) > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > find dependent libraries > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > at java.lang.System.loadLibrary(System.java:992) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > at > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > Source) > ... 8 more > > > 1) Has anyone run into a similar problem? > 2) My Windows C/C++ is very rusty - can someone point me at the link > dependencies for Win32? I might be able to see what is missing in > the Embedded environment that is present in the "desktop" environment. > Hi Ken There are only a hand full of api calls rxtx makes to w32. They are basic functions like: EscapeCommFunction CreateFile ClearCommError GetCommTimeouts GetCommState GetTickCount WaitForSingleObject WaitCommEvent WriteFile PurgeComm SetCommMask SetCommState It is easily possible that the rxtx compiles do not work with embeded windows because of something I've done wrong. The windows compiles are strange to say the least. I've never tried embeded xp. But I wonder if any normal serial comm application works with embeded windows. Have you tried some basic sanity tests? Do they use a different binary format by some odd chance? -- Trent Jarvi tjarvi at qbang.org From j.kenneth.gentle at acm.org Tue May 1 19:41:16 2007 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Tue, 01 May 2007 21:41:16 -0400 Subject: [Rxtx] RXTX 2.1.7r2 and Windows XP/Windows XP/Embedded Message-ID: <200705020141.l421fJWS025423@qbang.org> Thanks for the response, Trent. Win32 is *supposed* to be the same basic stuff on Windows XP and Windows XP/Embedded - binary compatible. They even have a .Net Framework for Embedded. "Embedded" has to be somewhat tongue-in-cheek as the install is still in the 10s of megabytes. Basic Serial/Parallel communications are *supposed* to be there, too. For example, "HyperTerm" is installed and works between two XP/Embedded boxes. As I mentioned in my post, I don't currently have an XP/Embedded box to test on -- however, I've acquired a box that I *can* put it on (and will, probably Friday morning - I'll be at a different client's site tomorrow and Thurs.). Hopefully by late Friday morning I'll know more. Thanks for the list of calls, Trent - that will help a document search between now and then. I'll post back to the list when I get this figured out. If anyone else has any experience or guesses, please don't hesitate to chime in! Ken At 21:27 2007-05-01, you wrote: >On Tue, 1 May 2007, Ken Gentle wrote: > > > Hello all! > > > > I've developed an app for a client targeting the Windows XP/Embedded > > environment. I'm using the JRE for Windows XP/Embedded from Sun (a > > J2SE 1.5 implementation) and the 2.1.7r2 RXTX Binaries. I've > > installed RXTX in the JRE prior to packaging, so the RXTXcomm.jar and > > rxtxSerial.dll are in the correct places. I don't install the > > rxtxParallel.dll. > > > > Ok, I can take two "normal" Windows Boxes (one Windows XP/Pro, the > > other Windows 2000 Pro), install the application with the Win > > XP/Embedded JRE and the two devices communicate wonderfully over a > > null modem cable. > > > > Unfortunately, I work remotely (about 900 miles) from my client and > > don't have immediate access to an XP/Embedded box. > > > > When he installs the software on two Windows XP/Embedded devices and > > tries to start up the application, the following error is recorded: > > > > SerialWireless Configuration loaded from "C:\Program > > Files\SerialWireless-Master\bin\..\conf\SerialWirelessConfig.properties" > > getSerialPort(): attempting to open serial port "COM3". > > java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries thrown while loading gnu.io.RXTXCommDriver > > > > com.gentlesoftware.serialwireless.SerialWirelessException: > > Unanticipated Exception > > at com.gentlesoftware.serialwireless.Master.start(Unknown Source) > > at com.gentlesoftware.serialwireless.Master.main(Unknown Source) > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > at > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > at java.lang.reflect.Method.invoke(Method.java:585) > > at > org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240) > > at java.lang.Thread.run(Thread.java:595) > > Caused by: java.lang.UnsatisfiedLinkError: C:\Program > > Files\SerialWireless-Master\jre-xp-embedded\bin\rxtxSerial.dll: Can't > > find dependent libraries > > at java.lang.ClassLoader$NativeLibrary.load(Native Method) > > at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751) > > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668) > > at java.lang.Runtime.loadLibrary0(Runtime.java:822) > > at java.lang.System.loadLibrary(System.java:992) > > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:83) > > at > > > com.gentlesoftware.serialwireless.SerialWirelessComponent.getSerialPort(Unknown > > Source) > > ... 8 more > > > > > > 1) Has anyone run into a similar problem? > > 2) My Windows C/C++ is very rusty - can someone point me at the link > > dependencies for Win32? I might be able to see what is missing in > > the Embedded environment that is present in the "desktop" environment. > > > >Hi Ken > >There are only a hand full of api calls rxtx makes to w32. They are basic >functions like: > >EscapeCommFunction >CreateFile >ClearCommError >GetCommTimeouts >GetCommState >GetTickCount >WaitForSingleObject >WaitCommEvent >WriteFile >PurgeComm >SetCommMask >SetCommState > >It is easily possible that the rxtx compiles do not work with embeded >windows because of something I've done wrong. The windows compiles >are strange to say the least. I've never tried embeded xp. But I wonder >if any normal serial comm application works with embeded windows. > >Have you tried some basic sanity tests? Do they use a different binary >format by some odd chance? > >-- >Trent Jarvi >tjarvi at qbang.org >_______________________________________________ >Rxtx mailing list >Rxtx at qbang.org >http://mailman.qbang.org/mailman/listinfo/rxtx From dirk.niemeier at stueken.de Wed May 2 08:20:22 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Wed, 02 May 2007 16:20:22 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 Message-ID: <46389E26.8090708@stueken.de> Hi again, isn't there anybody who can help me ? I tried with EventListener too, But I don't get any event. regards, Dirk >Hi, >I try to change from Sun Comm to RXTX but without success. I try version >RXTX-2.1-7. I can open the SerialPort, set params and write out to port. >But I didn't get any byte from serial port. > > portIdentifier = CommPortIdentifier.getPortIdentifier(portName); > CommPort commPort = >portIdentifier.open(this.getClass().getName(), 2000); > if (commPort instanceof SerialPort) > { > serialPort = (SerialPort) commPort; > serialPort.setSerialPortParams(9600, >SerialPort.DATABITS_8, SerialPort.STOPBITS_1, > SerialPort.PARITY_NONE); > serialPort.addEventListener(new SerialListener()); > serialPort.notifyOnDataAvailable(true); > > inputStream = serialPort.getInputStream(); > outputStream = serialPort.getOutputStream(); > > isInited = true; >// test read > for(;;) > getLogger().info( inputStream.read()); >The test read always return -1. When I change back the import to >"javax.comm.*" it works fine. The write to outputStream works fine. I >dont know why the reading doesn't work. Any suggestions ? -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070502/f4e2bbc0/dirk.niemeier-0025.vcf From naranjo.manuel at gmail.com Wed May 2 09:37:38 2007 From: naranjo.manuel at gmail.com (Manuel Naranjo) Date: Wed, 02 May 2007 12:37:38 -0300 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <46389E26.8090708@stueken.de> References: <46389E26.8090708@stueken.de> Message-ID: <4638B042.2030403@gmail.com> Dirk, I think you are missing the flow control you are going to use, and possible a timeout to the port. Try adding this: serialPort.enableReceiveTimeout(100); serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. Thanks, Manuel > Hi again, > isn't there anybody who can help me ? I tried with EventListener too, > But I don't get any event. > regards, > Dirk > >> Hi, >> I try to change from Sun Comm to RXTX but without success. I try >> version RXTX-2.1-7. I can open the SerialPort, set params and write >> out to port. But I didn't get any byte from serial port. >> >> portIdentifier = >> CommPortIdentifier.getPortIdentifier(portName); >> CommPort commPort = >> portIdentifier.open(this.getClass().getName(), 2000); >> if (commPort instanceof SerialPort) >> { >> serialPort = (SerialPort) commPort; >> serialPort.setSerialPortParams(9600, >> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >> SerialPort.PARITY_NONE); >> serialPort.addEventListener(new SerialListener()); >> serialPort.notifyOnDataAvailable(true); >> >> inputStream = serialPort.getInputStream(); >> outputStream = serialPort.getOutputStream(); >> >> isInited = true; >> // test read for(;;) >> getLogger().info( inputStream.read()); > >> The test read always return -1. When I change back the import to >> "javax.comm.*" it works fine. The write to outputStream works fine. I >> dont know why the reading doesn't work. Any suggestions ? > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From konrad.garus at gmail.com Wed May 2 10:20:48 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Wed, 2 May 2007 18:20:48 +0200 Subject: [Rxtx] Windows DLL broken? Message-ID: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Hello, I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some problems with the DLL supplied with the release (downloading from ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). Basically, it spits out a regular error of this kind: java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to some point. It's possible to list all serial ports, but the application hangs when trying to connect to one of them. It also issues a warning saying versions mismatch. I tried specifying native lib location in eclipse, as well as using java.library.path variable - any way no luck. How can I deal with it? Where can I find the right release (dll)? Thank you! -- Konrad K. Garus konrad.garus at gmail.com From tjarvi at qbang.org Wed May 2 18:42:35 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 2 May 2007 18:42:35 -0600 (MDT) Subject: [Rxtx] Windows DLL broken? In-Reply-To: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: On Wed, 2 May 2007, Konrad Garus wrote: > Hello, > > I'm trying to use RXTX-2.1-7pre20 on my Windows XP, but have some > problems with the DLL supplied with the release (downloading from > ftp://ftp.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip). > > Basically, it spits out a regular error of this kind: > > java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading > gnu.io.RXTXCommDriver > java.lang.NoClassDefFoundError thrown while loading gnu.io.RXTXCommDriver > I think this is because you are actually loading an old rxtxSerial.dll. You may take a look at your system and see that there isnt something on your path that you do not remember. > When I run it with an older dll (RXTX-2.0-7pre1 - devel), it works to > some point. It's possible to list all serial ports, but the > application hangs when trying to connect to one of them. It also > issues a warning saying versions mismatch. Again, if the versions mismatch, the wrong dll is loading. > > I tried specifying native lib location in eclipse, as well as using > java.library.path variable - any way no luck. > > How can I deal with it? Where can I find the right release (dll)? > > Thank you! > > rxtx-2.1-7-bins-r2.zip should be good. Just don't mix rxtx 2.0 and clear out the old dlls from your PATH. -- Trent Jarvi tjarvi at qbang.org From dirk.niemeier at stueken.de Thu May 3 00:22:23 2007 From: dirk.niemeier at stueken.de (Dirk Niemeier) Date: Thu, 03 May 2007 08:22:23 +0200 Subject: [Rxtx] Can't read on COM on WindowsXP and Java 1.5 In-Reply-To: <4638B042.2030403@gmail.com> References: <46389E26.8090708@stueken.de> <4638B042.2030403@gmail.com> Message-ID: <46397F9F.20305@stueken.de> Thanks everyone for answer, the advice of FlowControlMode was the right one. It's not the bug of ReceiveControl behavior when I use the EventManager. It don't have to be set. The problem is a bug in FlowControlMode. When SerialPort.FLOWCONTROL_NONE is set, the CTS has to be set active. With javax.comm.* it is the default value. So it isn't possible to use FLOWCONTROL_NONE without cutting the RTS/CTS cables. best regards, Dirk Manuel Naranjo schrieb: > Dirk, > I think you are missing the flow control you are going to use, and > possible a timeout to the port. > Try adding this: > serialPort.enableReceiveTimeout(100); > serialPort.setFlowControlMode(gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN | > gnu.io.SerialPort.FLOWCONTROL_RTSCTS_OUT); //For Hard Handshake. > Thanks, > Manuel > >> Hi again, >> isn't there anybody who can help me ? I tried with EventListener too, >> But I don't get any event. >> regards, >> Dirk >> >> >>> Hi, >>> I try to change from Sun Comm to RXTX but without success. I try >>> version RXTX-2.1-7. I can open the SerialPort, set params and write >>> out to port. But I didn't get any byte from serial port. >>> >>> portIdentifier = >>> CommPortIdentifier.getPortIdentifier(portName); >>> CommPort commPort = >>> portIdentifier.open(this.getClass().getName(), 2000); >>> if (commPort instanceof SerialPort) >>> { >>> serialPort = (SerialPort) commPort; >>> serialPort.setSerialPortParams(9600, >>> SerialPort.DATABITS_8, SerialPort.STOPBITS_1, >>> SerialPort.PARITY_NONE); >>> serialPort.addEventListener(new SerialListener()); >>> serialPort.notifyOnDataAvailable(true); >>> >>> inputStream = serialPort.getInputStream(); >>> outputStream = serialPort.getOutputStream(); >>> >>> isInited = true; >>> // test read for(;;) >>> getLogger().info( inputStream.read()); >>> >> >> >>> The test read always return -1. When I change back the import to >>> "javax.comm.*" it works fine. The write to outputStream works fine. I >>> dont know why the reading doesn't work. Any suggestions ? >>> >> >> >> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Dirk Niemeier IT-Abteilung Hubert St?ken GmbH&Co.KG Alte Todenmanner Stra?e 42 D-31737 Rinteln (Germany) Tel: 05751/702-177 Fax: 05751/702-188 Hubert St?ken GmbH & Co.KG Registergericht Stadthagen HRA 1026 Gesch?ftsf?hrer: Uwe Rapp, Dr.-Ing Hubert Schmidt VAT ID No.DE 116537996 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/attachment-0025.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Stuekenlogo Type: image/gif Size: 2771 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/Stuekenlogo-0025.gif -------------- next part -------------- A non-text attachment was scrubbed... Name: dirk.niemeier.vcf Type: text/x-vcard Size: 528 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20070503/831b9f34/dirk.niemeier-0025.vcf From konrad.garus at gmail.com Thu May 3 02:44:42 2007 From: konrad.garus at gmail.com (Konrad Garus) Date: Thu, 3 May 2007 10:44:42 +0200 Subject: [Rxtx] Windows DLL broken? In-Reply-To: References: <6645f6440705020920p6744abc4j726cd41703913d9b@mail.gmail.com> Message-ID: <6645f6440705030144x7c057f97na4bcfc45c50709e3@mail.gmail.com> Trent, thanks for your help. Unfortunately, apparently that was not the solution that would work for me. I found another native DLL that both loads properly (with the same path settings) and has the correct version. -- Konrad K. Garus konrad.garus at gmail.com From pmartin at ece.gatech.edu Fri May 4 10:50:34 2007 From: pmartin at ece.gatech.edu (Patrick Martin) Date: Fri, 04 May 2007 12:50:34 -0400 Subject: [Rxtx] Handling incoming serial data Message-ID: <463B645A.9060200@ece.gatech.edu> Hello all, I am interfacing my laptop to an Atmel chip via the serial port and RXTX. I am looking for examples on handling the incoming data in its raw byte form, i.e. I'd like to manipulate a stream of data like FF 02 03 0D... Has anyone tried to perform something similar? I know how to display as a string, but I think I am being thrown by Java using Unicode when I want to manipulate the bytes. Regards, -- Patrick Martin School of Electrical and Computer Engineering Georgia Institute of Technology From tod at todbot.com Fri May 4 11:42:07 2007 From: tod at todbot.com (Tod E. Kurt) Date: Fri, 4 May 2007 10:42:07 -0700 Subject: [Rxtx] Handling incoming serial data In-Reply-To: <463B645A.9060200@ece.gatech.edu> References: <463B645A.9060200@ece.gatech.edu> Message-ID: <83BF9321-E096-4313-930E-DE923CCCD1FE@todbot.com> Yes, Java sucks when it comes to bytes, because they decided to make bytes signed instead of unsigned. This means any byte value greater than 0x7f is going to give yo problems. And this means that to do anything useful, you have to cast to "int", mask with 0xff, then cast back to byte. So many times in my Java code that talks to microcontrollers, I do stuff like this: byte cmd[] = { (byte)0x89, (byte)byteRecvd, (byte)(intVal & 0xff) }; And then if you want to get at the (unsigned) number in a byte array, you have to cast it to int and mask it again: int r = cmd[1] & 0xff; // converts to unsigned int, 0-255 if( r > 100 ) { ... } It's kind of a mess. To get bytes from your microcontroller, you can implement a SerialPortEventListener which will get its serialEvent() method called. The InputStream and OutputStream you get from RXTX knows how to read() a byte and write() bytes[], respectively. -=tod On May 4, 2007, at 9:50 AM, Patrick Martin wrote: > Hello all, > I am interfacing my laptop to an Atmel chip via the serial port and > RXTX. I am looking for examples on handling the incoming data in > its raw > byte form, i.e. I'd like to manipulate a stream of data like FF 02 > 03 0D... > Has anyone tried to perform something similar? > > I know how to display as a string, but I think I am being thrown by > Java > using Unicode when I want to manipulate the bytes. > > Regards, > > -- > Patrick Martin > School of Electrical and Computer Engineering > Georgia Institute of Technology > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From gjhanna at gmail.com Sun May 6 17:45:37 2007 From: gjhanna at gmail.com (Greg Hanna) Date: Mon, 7 May 2007 11:45:37 +1200 Subject: [Rxtx] High CPU usage - ?? indirectly from addPortName ?? Message-ID: Hi All, I'm trying to track down a problem we're having. After about 3 days running, we get a "hot cpu" issue - my app is utilising all available CPU. It does this reasonably nicely - everything still runs and performs as before, but the CPU has no idle time. I get responses from the app, everything else on the box works fine. The thread dumps *seem* to point to where we're processing SerialEvents but it's pretty murky. I've been looking at the differences in our current version and a previous version that didn't have this issue (but had other issues). One of the things that I changed was, rather than enumerating the serial ports, I now create a new instance of gnu.io.RXTXCommDriver and pass that into CommPortIdentifier.addPortName () So the first time my app goes to use a particular comm port, it gets a NoSuchPortException, so I then use addPortName () to define the port and it works happily from there. Are these likely to be related? Has anyone come across this "hot cpu" issue before? Thanks, Greg H -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070507/969b81b5/attachment-0016.html From rithy8 at gmail.com Thu May 10 16:03:53 2007 From: rithy8 at gmail.com (rithy roth) Date: Thu, 10 May 2007 15:03:53 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. Message-ID: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Hi, I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components on an instrument. My application is a java app which makes call to the rxtx library. Recently, I got this weird looping error saying the following: Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access is denied. First, of all not sure if my boss like the /home/bob/foo thingy. Second, could someone please help me. How can i recover from this error? Thanks -rr -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070510/8d7bd15a/attachment-0025.html From tjarvi at qbang.org Thu May 10 18:20:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 10 May 2007 18:20:54 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: On Thu, 10 May 2007, rithy roth wrote: > Hi, > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic components > on an instrument. > > My application is a java app which makes call to the rxtx library. Recently, > I got this weird looping error saying the following: > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): Access > is denied. > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > could someone please help me. > > How can i recover from this error? > Strange the bob/foo actually helps a little. int ClearErrors( struct termios_list *index, COMSTAT *Stat ) { unsigned long ErrCode; int ret; ret = ClearCommError( index->hComm, &ErrCode, Stat ); if ( ret == 0 ) { YACK(); return( ret ); } ClearCommError is failing. Could it be that the port 'vanished?' bluetooth, usb dongle, ... Which windows are you using? -- Trent Jarvi tjarvi at qbang.org From rithy8 at gmail.com Fri May 11 10:32:16 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 09:32:16 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> Message-ID: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Trent, Thanks for responding. I running the app on windows XP service pack 2. Trent i believe someone might have accidentaly mucking around with the usb-to serial box. So, I am scratching my head what to do in terms of helping my instrument users. My java app did not get any exception, and I can not put up a dialog box. I am thinking of downloading the final 2.1-7 dll again and make sure i replace Bob's version, but not sure if it will help. What do you think? -rr On 5/10/07, Trent Jarvi wrote: > > On Thu, 10 May 2007, rithy roth wrote: > > > Hi, > > > > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > components > > on an instrument. > > > > My application is a java app which makes call to the rxtx library. > Recently, > > I got this weird looping error saying the following: > > > > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > Access > > is denied. > > > > First, of all not sure if my boss like the /home/bob/foo thingy. Second, > > could someone please help me. > > > > How can i recover from this error? > > > > Strange > > the bob/foo actually helps a little. > > int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > { > unsigned long ErrCode; > int ret; > > ret = ClearCommError( index->hComm, &ErrCode, Stat ); > if ( ret == 0 ) > { > YACK(); > return( ret ); > } > > > ClearCommError is failing. Could it be that the port 'vanished?' > bluetooth, usb dongle, ... > > Which windows are you using? > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/441bb227/attachment-0025.html From tjarvi at qbang.org Fri May 11 11:08:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 11 May 2007 11:08:04 -0600 (MDT) Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: Hi Rithy The bob/foo is the directory rxtx was compiled in. Bob is a general user account on a server that is used for cross compiling windows. Upgrading will not help. We are going to get rid of the messages but you have the 'right' version installed. Just glue the USB ports into computer for now. On Fri, 11 May 2007, rithy roth wrote: > Trent, > > Thanks for responding. I running the app on windows XP service pack 2. > Trent i believe someone might have accidentaly mucking around with the > usb-to serial box. > > So, I am scratching my head what to do in terms of helping my instrument > users. > My java app did not get any exception, and I can not put up a dialog box. > > I am thinking of downloading the final 2.1-7 dll again and make sure i > replace Bob's version, but not sure if > it will help. What do you think? > > -rr > > On 5/10/07, Trent Jarvi wrote: >> >> On Thu, 10 May 2007, rithy roth wrote: >> >> > Hi, >> > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic >> components >> > on an instrument. >> > >> > My application is a java app which makes call to the rxtx library. >> Recently, >> > I got this weird looping error saying the following: >> > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): >> Access >> > is denied. >> > >> > First, of all not sure if my boss like the /home/bob/foo thingy. Second, >> > could someone please help me. >> > >> > How can i recover from this error? >> > >> >> Strange >> >> the bob/foo actually helps a little. >> >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) >> { >> unsigned long ErrCode; >> int ret; >> >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); >> if ( ret == 0 ) >> { >> YACK(); >> return( ret ); >> } >> >> >> ClearCommError is failing. Could it be that the port 'vanished?' >> bluetooth, usb dongle, ... >> >> Which windows are you using? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > From rithy8 at gmail.com Fri May 11 11:40:31 2007 From: rithy8 at gmail.com (rithy roth) Date: Fri, 11 May 2007 10:40:31 -0700 Subject: [Rxtx] rxtx caught in infinite loop. please help. In-Reply-To: References: <79e2547b0705101503u34601415te1b9ca63f46824e6@mail.gmail.com> <79e2547b0705110932l737cbcb2u114b42ce45f572aa@mail.gmail.com> Message-ID: <79e2547b0705111040s11b33a70yd9fc49897385d263@mail.gmail.com> Trent, thank you. I will shoot anyone who tries to touch the usb box. On 5/11/07, Trent Jarvi wrote: > > > Hi Rithy > > The bob/foo is the directory rxtx was compiled in. Bob is a general user > account on a server that is used for cross compiling windows. Upgrading > will not help. > > We are going to get rid of the messages but you have the 'right' version > installed. Just glue the USB ports into computer for now. > > On Fri, 11 May 2007, rithy roth wrote: > > > Trent, > > > > Thanks for responding. I running the app on windows XP service pack 2. > > Trent i believe someone might have accidentaly mucking around with the > > usb-to serial box. > > > > So, I am scratching my head what to do in terms of helping my instrument > > users. > > My java app did not get any exception, and I can not put up a dialog > box. > > > > I am thinking of downloading the final 2.1-7 dll again and make sure i > > replace Bob's version, but not sure if > > it will help. What do you think? > > > > -rr > > > > On 5/10/07, Trent Jarvi wrote: > >> > >> On Thu, 10 May 2007, rithy roth wrote: > >> > >> > Hi, > >> > > >> > I am using rxtx library(in rxtx-2.1-7-bins-r2.zip) to run fluidic > >> components > >> > on an instrument. > >> > > >> > My application is a java app which makes call to the rxtx library. > >> Recently, > >> > I got this weird looping error saying the following: > >> > > >> > Error 0x5 at /home/bob/foo/rxtx-devel/build/../src/termios.c(482): > >> Access > >> > is denied. > >> > > >> > First, of all not sure if my boss like the /home/bob/foo thingy. > Second, > >> > could someone please help me. > >> > > >> > How can i recover from this error? > >> > > >> > >> Strange > >> > >> the bob/foo actually helps a little. > >> > >> int ClearErrors( struct termios_list *index, COMSTAT *Stat ) > >> { > >> unsigned long ErrCode; > >> int ret; > >> > >> ret = ClearCommError( index->hComm, &ErrCode, Stat ); > >> if ( ret == 0 ) > >> { > >> YACK(); > >> return( ret ); > >> } > >> > >> > >> ClearCommError is failing. Could it be that the port 'vanished?' > >> bluetooth, usb dongle, ... > >> > >> Which windows are you using? > >> > >> -- > >> Trent Jarvi > >> tjarvi at qbang.org > >> _______________________________________________ > >> Rxtx mailing list > >> Rxtx at qbang.org > >> http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20070511/8d07d226/attachment-0025.html From arnab.bhaumik at gmail.com Sat Ma